package club.lovety.code.thread.pool;

import java.util.concurrent.*;

/**
 * <p>
 * 这里写有象视频代码描述
 * </p>
 *
 * @author sunmc
 * @date created in 2018/4/25 12:51
 * @since
 */
public class ExecJavaThreadPoolTest {

    public static void main(String[] args) {
        ThreadPoolExecutor executorService =  new ThreadPoolExecutor(0, 8,
                60L, TimeUnit.MILLISECONDS,
                new LinkedBlockingDeque<>());


        for(int index=0;index<100;index++){
            executorService.execute(()->{
//                try {
//                    Thread.sleep(4000L);
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
                System.out.println(Thread.currentThread().getName());
            });
        }


        LinkedBlockingDeque<String> linkedBlockingDeque = new LinkedBlockingDeque<>();
        linkedBlockingDeque.add("222");
        linkedBlockingDeque.offer("ddd");

        System.out.println("2222222222222");


    }




}
